<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">

<html><head><title>RegexTokenizer</title><link rel="stylesheet" type="text/css" href="../../../styles/main.css"><script language=JavaScript src="../../../javascript/main.js"></script><script language=JavaScript src="../../../javascript/searchdata.js"></script></head><body class="ContentPage" onLoad="NDOnLoad()"><script language=JavaScript><!--
if (browserType) {document.write("<div class=" + browserType + ">");if (browserVer) {document.write("<div class=" + browserVer + ">"); }}// --></script>

<!--  Generated by Natural Docs, version 1.4 -->
<!--  http://www.naturaldocs.org  -->

<!-- saved from url=(0026)http://www.naturaldocs.org -->




<div id=Content><div class="CClass"><div class=CTopic id=MainTopic><h1 class=CTitle><a name="RegexTokenizer"></a>RegexTokenizer</h1><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>class RegexTokenizer</td></tr></table></blockquote><p>A class that allows one to tokenize a string based on a regular expression</p><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SMain"><td class=SEntry><a href="#RegexTokenizer" id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')">RegexTokenizer</a></td><td class=SDescription>A class that allows one to tokenize a string based on a regular expression</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#RegexTokenizer.Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#RegexTokenizer.RegexTokenizer" id=link2 onMouseOver="ShowTip(event, 'tt2', 'link2')" onMouseOut="HideTip('tt2')">RegexTokenizer</a></td><td class=SDescription>Creates an empty tokenizer</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#RegexTokenizer.RegexTokenizer" id=link3 onMouseOver="ShowTip(event, 'tt2', 'link3')" onMouseOut="HideTip('tt2')">RegexTokenizer</a></td><td class=SDescription>Creates a tokenizer with a given regex</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#RegexTokenizer.SetExpression" id=link4 onMouseOver="ShowTip(event, 'tt3', 'link4')" onMouseOut="HideTip('tt3')">SetExpression</a></td><td class=SDescription>Sets the regular expression to use. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#RegexTokenizer.GetExpression" id=link5 onMouseOver="ShowTip(event, 'tt4', 'link5')" onMouseOut="HideTip('tt4')">GetExpression</a></td><td class=SDescription>Returns the current regular expression</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#RegexTokenizer.Tokenize" id=link6 onMouseOver="ShowTip(event, 'tt5', 'link6')" onMouseOut="HideTip('tt5')">Tokenize</a></td><td class=SDescription>Tokenizes the given item. </td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="RegexTokenizer.Functions"></a>Functions</h3></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="RegexTokenizer.RegexTokenizer"></a>RegexTokenizer</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>RegexTokenizer()</td></tr></table></blockquote><p>Creates an empty tokenizer</p><h4 class=CHeading>Parameters</h4><p>None</p><h4 class=CHeading>Throws</h4><p>Never</p><h4 class=CHeading>Returns</h4><p>-</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="RegexTokenizer.RegexTokenizer"></a>RegexTokenizer</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>RegexTokenizer(</td><td class=PTypePrefix nowrap>std::</td><td class=PType nowrap>string&nbsp;</td><td class=PParameter nowrap>regex,</td><td class=PDefaultValuePrefix>&nbsp;&nbsp;</td><td class=PDefaultValue width=100%></td></tr><tr><td></td><td class=PTypePrefix nowrap></td><td class=PType nowrap>bool&nbsp;</td><td class=PParameter nowrap>case_senstive</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%> true</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Creates a tokenizer with a given regex</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>std::string regex</td><td class=CDLDescription>A valid regular expression</td></tr><tr><td class=CDLEntry>bool case_senstive</td><td class=CDLDescription>default = true</td></tr></table><h4 class=CHeading>Throws</h4><p>If an incorrect regex is entered, it will not throw.&nbsp; When you use <a href="#RegexTokenizer.Tokenize" class=LFunction id=link7 onMouseOver="ShowTip(event, 'tt5', 'link7')" onMouseOut="HideTip('tt5')">Tokenize</a> an exception will be thrown.</p><h4 class=CHeading>Returns</h4><p>-</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="RegexTokenizer.SetExpression"></a>SetExpression</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>void SetExpression(</td><td class=PTypePrefix nowrap>std::</td><td class=PType nowrap>string&nbsp;</td><td class=PParameter nowrap>exp,</td><td class=PDefaultValuePrefix>&nbsp;&nbsp;</td><td class=PDefaultValue width=100%></td></tr><tr><td></td><td class=PTypePrefix nowrap></td><td class=PType nowrap>bool&nbsp;</td><td class=PParameter nowrap>case_sensitive</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%> true</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Sets the regular expression to use.&nbsp; Does not throw on an invalid regex.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>exp</td><td class=CDLDescription>A valid regular expression.</td></tr><tr><td class=CDLEntry>case_sensitive</td><td class=CDLDescription>Defines if a regex search should be case sensitive.&nbsp; Defaults to true (case sensitive).</td></tr></table><h4 class=CHeading>Throws</h4><p>std::runtime_error on invalid regex</p><h4 class=CHeading>Returns</h4><p>void</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="RegexTokenizer.GetExpression"></a>GetExpression</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>std::string GetExpression()</td></tr></table></blockquote><p>Returns the current regular expression</p><h4 class=CHeading>Parameters</h4><p>None.</p><h4 class=CHeading>Throws</h4><p>Never.</p><h4 class=CHeading>Returns</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>std::string</td><td class=CDLDescription>String representation of the regular expression</td></tr></table></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="RegexTokenizer.Tokenize"></a>Tokenize</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>template&lt;typename T&gt; std::vector&lt;T&gt; Tokenize(</td><td class=PTypePrefix nowrap>std::</td><td class=PType nowrap>string&nbsp;</td><td class=PParameter nowrap>item</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Tokenizes the given item.&nbsp; Each match is put into the returning vector</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>std::string item</td><td class=CDLDescription>String to tokenize.</td></tr></table><h4 class=CHeading>Throws</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>std::runtime_error</td><td class=CDLDescription>Thrown on either: a) an invalid cast b/w type T and the result from the regular expression match ( &ldquo;asdf&rdquo; -&gt; int). b) an invalid regular expression</td></tr></table><h4 class=CHeading>Returns</h4><p>A vector holding each match.</p></div></div></div>

</div><!--Content-->


<div id=Footer><a href="http://www.naturaldocs.org">Generated by Natural Docs</a></div><!--Footer-->


<div id=Menu><div class=MEntry><div class=MFile><a href="AsciiRaster-h.html">AsciiRaster.h</a></div></div><div class=MEntry><div class=MFile><a href="Clock-h.html">Clock.h</a></div></div><div class=MEntry><div class=MFile><a href="Logger-h.html">Logger.h</a></div></div><div class=MEntry><div class=MFile><a href="Observation-h.html">Observation</a></div></div><div class=MEntry><div class=MFile><a href="Raster-h.html">Raster.h</a></div></div><div class=MEntry><div class=MFile id=MSelected>RegexTokenizer</div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent1')">Index</a><div class=MGroupContent id=MGroupContent1><div class=MEntry><div class=MIndex><a href="../../../index/General.html">Everything</a></div></div><div class=MEntry><div class=MIndex><a href="../../../index/Classes.html">Classes</a></div></div><div class=MEntry><div class=MIndex><a href="../../../index/Functions.html">Functions</a></div></div><div class=MEntry><div class=MIndex><a href="../../../index/Files.html">Files</a></div></div><div class=MEntry><div class=MIndex><a href="../../../index/Constants.html">Constants</a></div></div><div class=MEntry><div class=MIndex><a href="../../../index/Types.html">Types</a></div></div></div></div></div><script type="text/javascript"><!--
var searchPanel = new SearchPanel("searchPanel", "HTML", "../../../search");
--></script><div id=MSearchPanel class=MSearchPanelInactive><input type=text id=MSearchField value=Search onFocus="searchPanel.OnSearchFieldFocus(true)" onBlur="searchPanel.OnSearchFieldFocus(false)" onKeyUp="searchPanel.OnSearchFieldChange()"><select id=MSearchType onFocus="searchPanel.OnSearchTypeFocus(true)" onBlur="searchPanel.OnSearchTypeFocus(false)" onChange="searchPanel.OnSearchTypeChange()"><option  id=MSearchEverything selected value="General">Everything</option><option value="Classes">Classes</option><option value="Constants">Constants</option><option value="Files">Files</option><option value="Functions">Functions</option><option value="Types">Types</option></select></div></div><!--Menu-->



<!--START_ND_TOOLTIPS-->
<div class=CToolTip id="tt1"><div class=CClass><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>class RegexTokenizer</td></tr></table></blockquote>A class that allows one to tokenize a string based on a regular expression</div></div><div class=CToolTip id="tt2"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>RegexTokenizer()</td></tr></table></blockquote>Creates an empty tokenizer</div></div><div class=CToolTip id="tt3"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>void SetExpression(</td><td class=PTypePrefix nowrap>std::</td><td class=PType nowrap>string&nbsp;</td><td class=PParameter nowrap>exp,</td><td class=PDefaultValuePrefix>&nbsp;&nbsp;</td><td class=PDefaultValue width=100%></td></tr><tr><td></td><td class=PTypePrefix nowrap></td><td class=PType nowrap>bool&nbsp;</td><td class=PParameter nowrap>case_sensitive</td><td class=PDefaultValuePrefix>&nbsp;=&nbsp;</td><td class=PDefaultValue width=100%> true</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Sets the regular expression to use. </div></div><div class=CToolTip id="tt4"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>std::string GetExpression()</td></tr></table></blockquote>Returns the current regular expression</div></div><div class=CToolTip id="tt5"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>template&lt;typename T&gt; std::vector&lt;T&gt; Tokenize(</td><td class=PTypePrefix nowrap>std::</td><td class=PType nowrap>string&nbsp;</td><td class=PParameter nowrap>item</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Tokenizes the given item. </div></div><!--END_ND_TOOLTIPS-->




<div id=MSearchResultsWindow><iframe src="" frameborder=0 name=MSearchResults id=MSearchResults></iframe><a href="javascript:searchPanel.CloseResultsWindow()" id=MSearchResultsWindowClose>Close</a></div>


<script language=JavaScript><!--
if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html>